<?php

/**
 * CondoritoProfesor filter form base class.
 *
 * @package    condorito
 * @subpackage filter
 * @author     Freddy Daniel Garcia
 */
abstract class BaseCondoritoProfesorFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'codigo'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'primer_nombre'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'primer_apellido'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'proyecto_curricular' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'tipo_identificacion' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'identificacion'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'correo_personal'     => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'codigo'              => new sfValidatorPass(array('required' => false)),
      'primer_nombre'       => new sfValidatorPass(array('required' => false)),
      'primer_apellido'     => new sfValidatorPass(array('required' => false)),
      'proyecto_curricular' => new sfValidatorPass(array('required' => false)),
      'tipo_identificacion' => new sfValidatorPass(array('required' => false)),
      'identificacion'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'correo_personal'     => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('condorito_profesor_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'CondoritoProfesor';
  }

  public function getFields()
  {
    return array(
      'id'                  => 'Number',
      'codigo'              => 'Text',
      'primer_nombre'       => 'Text',
      'primer_apellido'     => 'Text',
      'proyecto_curricular' => 'Text',
      'tipo_identificacion' => 'Text',
      'identificacion'      => 'Number',
      'correo_personal'     => 'Text',
      'id_usuario'          => 'ForeignKey',
    );
  }
}
